package com.wm.ad_navi_new.skin.attr.subclass

import android.graphics.drawable.Drawable
import android.view.View
import com.wm.ad_navi_new.skin.AbstractSkinAttr
import com.wm.ad_navi_new.skin.util.SkinResourcesUtil

class BackgroundAttr : AbstractSkinAttr() {

    override fun applySkin(view: View?) {
        if (view == null) {
            return
        }
        if (isColor()) {
            val color: Int = SkinResourcesUtil.getColor(attrValueRefId)
            view.setBackgroundColor(color)
        } else if (isDrawable()) {
            val bg: Drawable? = SkinResourcesUtil.getDrawable(attrValueRefId)
            view.background = bg
        }
    }




}